package Covid3;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class Covid3Mapper extends Mapper<LongWritable, Text,CovidBean2,Text> {

    @Override
    protected void map(LongWritable key, Text value, Mapper<LongWritable, Text, CovidBean2, Text>.Context context) throws IOException, InterruptedException {

        String line = value.toString();
        String words[] = line.split("\t");
        CovidBean2 outkey = new CovidBean2(Long.parseLong(words[1]),Long.parseLong(words[2]));
        Text outvalue = new Text(words[0]);
        context.write(outkey,outvalue);

    }
}
